package annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StudentMain {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("annotation/Bean.xml");
        Student student1 = (Student) context.getBean("student2");
        System.out.println(student1.getName() + " " + student1.getAge() + " " + student1.getGrade().getiNumber());

        GoodStudent goodStudent1 = (GoodStudent) context.getBean("goodstudent1");
        goodStudent1.getInfo();
    }
}
